home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
tcoop10a.zip
/
DEMO.ZIP
/
TESTMS.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1991-11-20
|
957b
|
54 lines
//
// TESTMS.CPP
// version 1.00 11/15/91
// test file for Mouse Class
// copyright (c) 1991 by James S. Clark
// all rights reserved
//
#pragma inline
#include <stdio.h>
#include "mouse.hpp"
static void interrupthandler()
{
static int unsigned func, newx, newy;
// static Event event;
asm mov bp, DGROUP // correct the data segment
asm mov ds, bp
func = _AX; // save the current position
newx = _CX;
newy = _DX;
// event.time = biostime(0); // save the event data
// event.x = newx;
// event.y = newy;
// event.func = func;
// add the event to the event queue
// and exit
puts("mouse handler called!");
} // interrupthandler
main()
{
Mouse mouse;
int x, y, button = 0;
if (mouse.active) {
mouse.usertask(0x03, (function) interrupthandler);
mouse.show();
while (button == 0) button = mouse.getstate(&x, &y);
mouse.hide();
}
}